PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Appearance Manager >

Programming With the Appearance Manager


DrawThemeMenuItem

Draws a menu item.

pascal OSStatus DrawThemeMenuItem (
                     const Rect *inMenuRect,
                     const Rect *inItemRect,
                     SInt16 inVirtualMenuTop,
                     SInt16 inVirtualMenuBottom,
                     ThemeMenuState inState,
                     ThemeMenuItemType inItemType,
                     MenuItemDrawingUPP inDrawProc,
                     UInt32 inUserData);
inMenuRect
A pointer to a structure of type Rect . Before calling DrawThemeMenuItem , set the rectangle to contain the entire menu, in global coordinates. This is the actual menu rectangle as used in your menu definition function.
inItemRect
A pointer to a structure of type Rect . Before calling DrawThemeMenuItem , set the rectangle to contain the menu item, in global coordinates. The menu item's background is drawn in the rectangle passed in the inItemRect parameter. You should calculate the size of the menu item's content and then call GetThemeMenuItemExtra to get the amount of padding surrounding menu items in the current theme; the width and height of the menu item rectangle are determined by adding these values together.
inVirtualMenuTop
A signed 16-bit integer. Pass a value representing the actual top of the menu. Normally this value is the top coordinate of the rectangle supplied in the inMenuRect parameter. This value could be different, however, if a menu is scrolled or bigger than can be displayed in the menu rectangle. You typically pass the value of the global variable TopMenuItem into this parameter if you are writing a custom menu definition function.
inVirtualMenuBottom
A signed 16-bit integer. Pass a value representing the actual bottom of the menu. Typically this value is the bottom coordinate of the rectangle supplied in the inMenuRect parameter. This value could be different, however, if a menu is scrolled or bigger than can be displayed in the menu rectangle. You typically pass the value of the global variable AtMenuBottom into this parameter if you are writing a custom menu definition function.
inState
A value of type ThemeMenuState . Pass a constant specifying the state (active, selected, or disabled) in which to draw the menu item; see Theme Menu State Constants .
inItemType
A value of type ThemeMenuItemType . If you pass kThemeMenuItemScrollUpArrow or kThemeMenuItemScrollDownArrow , then you should pass NULL for the inDrawProc parameter, since there is no content to be drawn. If you pass kThemeMenuItemHierarchical , the hierarchical arrow is drawn for you. See Theme Menu Item Type Constants for descriptions of possible values.
inDrawProc
A value of type MenuItemDrawingUPP . Pass a universal procedure pointer to a menu item drawing function such as MyMenuItemDrawingProc . The value of the inDrawProc parameter can be a valid universal procedure pointer or NULL .
inUserData
An unsigned 32-bit integer. Provide any data to be passed in to the inUserData parameter of MyMenuItemDrawingProc .
function result
A result code; see Result Codes .
DISCUSSION

The DrawThemeMenuItem function draws a theme-compliant menu item.

VERSION NOTES

Available with Appearance Manager 1.0.1 and later.


© 1999 Apple Computer, Inc. – (Last Updated 29 April 99)